// 加载中
import { reactive } from 'vue'
import { defineStore } from 'pinia'

export const useStateConfigStore = defineStore('stateConfigStore', () => {

    const stateConfig = reactive(
        JSON.parse(localStorage.getItem('stateConfig') as string) || {
            autoRefresh: false, // 自动刷新
            newOrderVoice: false, // 新订单语音
            orderWaitTicketVoice: false, // 待出票语音
            autoQuotation: false, // 自动报价
            acceptTransferOrder: false // 接受转单
        }
    )
    function changeStateConfig(key: any, value: boolean) {
        stateConfig[key] = value
        localStorage.setItem('stateConfig', JSON.stringify(stateConfig))
    }
    return { stateConfig, changeStateConfig }
})


